module.exports = (app)=>{
    //电话号码校验
    app.validator.addRule('tel', (rule, value) => {
       if(!/^[1]{1}[345789]{1}[0-9]{9}$/.test(value)){
           return "手机号码填写错误";
       }
    });

    //校验密码
    app.validator.addRule('password', (rule, value) => {
        if(!value || value.length < 6){
            return "密码错误";
        }
     });
}